package com.thoughtworks;

/**
 * Created by daisyshih on 2014-09-14.
 */

/**
 * FizzBuzz is a simple number game where you count, but say "Fizz" and/or "Buzz" instead of numbers adhering to certain rules.
 * <p/>
 * Create a FizzBuzz() method that prints out the numbers 1 through 100.
 * Instead of numbers divisible by three print "Fizz".
 * Instead of numbers divisible by five print "Buzz".
 * Instead of numbers divisible by three and five print "FizzBuzz".
 * <p/>
 * Sample Output:
 * 1
 * 2
 * Fizz
 * 4
 * Buzz
 * Fizz
 * 7
 * 8
 * Fizz
 * Buzz
 * 11
 * Fizz
 * 13
 * 14
 * FizzBuzz
 */
public class FizzBuzz {

    public static void fizzBuzz() {
        for (int i = 1; i <= 100; i++) {
            if(i%3 == 0 && i%5 == 0){
                System.out.print("FizzBuzz");
                System.out.println();
            }
            else if (i % 3 == 0) {
                System.out.print("Fizz");
                System.out.println();
            }
            else if (i % 5 == 0) {
                System.out.print("Buzz");
                System.out.println();
            } else {
                System.out.print(i);
                System.out.println();
            }
        }
    }

    public static void main(String[] args){
        fizzBuzz();
    }
}
